package cz.muni.fi.pa165.musiclibrary.api.service.dto;

import javax.annotation.Nonnull;

import org.joda.time.LocalDate;

import cz.muni.fi.pa165.musiclibrary.api.service.IAlbumService;

/**
* Data transfer object for {@link IAlbum} entity used in {@link IAlbumService} calls.
* 
* @author Radoslav Stefanik 
* 2012-10-28T15:53:16+0100
*/
public interface IAlbumDTO extends IDTOObject {
    /**
     * Returns identifier of this album.
     * @return Identifier of this album.
     */
    Long getIdAlbum();
    
    /**
     * Returns title of this album.
     * @return Title of this album.
     */
    @Nonnull
    String getTitle();
    
    /**
     * Returns release date of this album.
     * @return Release date of this album.
     */
    @Nonnull
    LocalDate getReleaseDate();
    
    /**
     * Returns album art of this album as an array of bytes.
     * @return Album art of this album as an array of bytes.
     */
    byte[] getAlbumArt();
    
    /**
     * Sets identifier of this album.
     * @param idAlbum Identifier of this album. Cannot be {@code null}.
     */
    void setIdAlbum(@Nonnull final Long idAlbum);
    
    /**
     * Sets title of this album.
     * @param title Title of this album. Cannot be {@code null}.
     */
    void setTitle(@Nonnull final String title);
    
    /**
     * Sets release date of this album.
     * @param releaseDate Release date of this album. Cannot be {@code null}.
     */
    void setReleaseDate(@Nonnull final LocalDate releaseDate);
    
    /**
     * Sets album art of this album.
     * @param albumArt Album art of this album.
     */
    void setAlbumArt(final byte[] albumArt);
    
    /**
     * Two albums are equal, if and only if their identifiers 
     * ({@link #getIdAlbum()}) are equal.
     * 
     * @param obj The reference object with which to compare.
     * @return {@code true} if this object is the same as the obj
     *          argument; {@code false} otherwise.
     */
    @Override
    boolean equals(final Object obj);
    
    /**
     * Returns hash code value for this object based on {@link #getIdAlbum()} value. 
     * @return Hash code value for this object.
     */
    @Override
    int hashCode();
}
